{
  "properties" : { },
  "id" : "97f505ea6dea451984497f73e4a62ac9",
  "script" : null,
  "groupId" : "74af8e1135d2474eb9b6b4081e6d5967",
  "name" : "查询接口状态返回布局",
  "createTime" : 1727071043813,
  "updateTime" : 1726653317942,
  "lock" : "1",
  "createBy" : "ndmp",
  "updateBy" : "ndmp",
  "path" : "getInterfaceStatusByLayout",
  "method" : "GET",
  "parameters" : [ {
    "name" : "deviceId",
    "value" : "D1216562515341899188",
    "description" : "",
    "required" : false,
    "dataType" : "String",
    "type" : "",
    "defaultValue" : "",
    "validateType" : "",
    "error" : "",
    "expression" : "",
    "children" : [ ]
  } ],
  "options" : [ ],
  "requestBody" : "",
  "headers" : [ ],
  "paths" : [ ],
  "responseBody" : "{\n    \"code\": 500,\n    \"success\": false,\n    \"data\": {},\n    \"msg\": \"系统维护中，请稍后重试。\"\n}",
  "description" : "",
  "requestBodyDefinition" : {
    "name" : "",
    "value" : { },
    "description" : "",
    "required" : false,
    "dataType" : "String",
    "type" : "",
    "defaultValue" : "",
    "validateType" : "",
    "error" : "",
    "expression" : "",
    "children" : [ ]
  },
  "responseBodyDefinition" : {
    "name" : "",
    "value" : { },
    "description" : "",
    "required" : false,
    "dataType" : "String",
    "type" : "",
    "defaultValue" : "",
    "validateType" : "",
    "error" : "",
    "expression" : "",
    "children" : [ ]
  }
}
================================
 import redis
 import java.util.stream.Collectors
 import "@/util/getPortByType" as getPortByType
 import "@/util/getConsole" as getConsole
 import "@/util/filterVirif" as filterVirif
 import "@/util/getPower" as getPower
 import "@/util/getOther" as getOther
 import "@/util/listSort" as listSort



 String IF_ADMIN_STATUS = "ifAdminStatus";
 String IF_OPER_STATUS = "ifOperStatus";
 String IF_INDEX = "ifIndex";
 String IF_IP = "ifIp";
 String IF_DESCR = "ifDescr";
 String IF_TYPE = "ifType";

 List list = Arrays.asList(IF_ADMIN_STATUS, IF_OPER_STATUS, IF_INDEX, IF_IP, IF_DESCR, IF_TYPE);
 List jsonData = redis.getPoint(deviceId, list)


 //  get   虚拟口
 List virIf = getPortByType(deviceId, jsonData, 1)


 // get console口
 List console = getConsole(deviceId, jsonData);

 // get 电口
 List electrical = getPortByType(deviceId, jsonData, 3);
 electrical = filterVirif(virIf, electrical);

 // get 光口
 List fiber = getPortByType(deviceId, jsonData, 4);
 fiber = filterVirif(virIf, fiber);

 // get 电源状态
 List devPower = getPower(deviceId);
 // 剩余就是其他口
 List other = getOther(deviceId, jsonData);
 other = filterVirif(virIf, other);

 List mIf = virIf.stream().filter(v -> v.get("name")::string.startsWith("Serial") && "工作".equals(v.get("status"))).collect(Collectors.toList());

 List newVirIf = virIf.stream().filter(v -> !v.get("name").startsWith("Serial")).collect(Collectors.toList());


 var jsonObject = {
     "fiber": listSort(fiber),
     "electrical": listSort(electrical),
     "other": listSort(other),
     "console": listSort(console),
     "virIf": listSort(newVirIf),
     "switch": devPower,
     "2mIf": mIf,
 }


 return jsonObject